package spells;

public class DoT extends StatusEffect{

	int periodicDamage;
	double tickTime;
	double timeSinceTick;
	String type; //"HoT" or "DoT"
	
	public DoT(int newDamage)
	{
		super();
		periodicDamage = newDamage;
		tickTime = 1;
		timeSinceTick = 0;
		type = "DoT";
	}
	
	public DoT(int newDamage, int newTickTime)
	{
		super();
		periodicDamage = newDamage;
		tickTime = newTickTime;
		timeSinceTick = 0;
		type = "DoT";
	}

	public DoT(int newDamage, double newTickTime, double newDuration)
	{
		super(newDuration);
		periodicDamage = newDamage;
		tickTime = newTickTime;
		timeSinceTick = 0;
		type = "DoT";
	}
	
	public DoT(int newDamage, double newTickTime, double newDuration, String newType)
	{
		super(newDuration);
		periodicDamage = newDamage;
		tickTime = newTickTime;
		timeSinceTick = 0;
		type = newType;
	}

	public int getDamage()
	{
		return periodicDamage;
	}
	
	public double getTickTime()
	{
		return tickTime;
	}
	
	public double getTimeSinceTick()
	{
		return timeSinceTick;
	}
	
	public void setTimeSinceTick(double time)
	{
		timeSinceTick = time;
	}
	
	public String displayChange(String creatureName)
	{
		if (type == "DoT")
		{
			return creatureName + " suffers " + getDamage() + " damage from " + name;
		}
		else
		{
			return creatureName + " regains " + getDamage() + " health from " + name;
		}
	}
	
}
